﻿@using PagedList
@using PagedList.Mvc
@model PMKB_Repository.UserListViewModel

@{
    ViewBag.Title = @PMKB_DAL.PMKBEntities_resource.User_List_Page_Title;
	int i=Model.items.FirstItemOnPage;;
}

<h2>@PMKB_DAL.PMKBEntities_resource.User_List</h2>
@PMKB_DAL.PMKBEntities_resource.User_Found_Generic(Model.items.TotalItemCount) @Html.Raw(string.IsNullOrEmpty(Model.Search.Search) ? "<a href='javascript:SearchData()'><small><sub>Search</sub></small></a>" : string.Format("(searching for {0} <small><sub>{1}</sub></small>)", Model.Search.Search, Html.ActionLink("remove", MVC.User.Index())))

<table>
    <tr>
		<th>Nr</th>
        <th>
            
			@PMKB_DAL.PMKBEntities_resource.User_UserName_Label
        </th>
        <th>Actions</th>
    </tr>

@foreach (var item in Model.items) {
	var trid = string.Format("User_{0}", item.UserID);
    <tr id="@trid">
		<td>@i</td>
        <td>
            @Html.DisplayFor(modelItem => item.UserName)
        </td>
        <td>
            @Html.ActionLink(PMKB_DAL.PMKBEntities_resource.User_Edit_Param("") , MVC.User.Edit(item.UserID )) 
			<text>|
			<a href="javascript:Delete('@Url.Action(MVC.User.Delete())',@item.UserID, '@item.UserName.ToString().Replace("'","\\'")',function(){$('#'+ '@trid').hide();})">
        @PMKB_DAL.PMKBEntities_resource.User_Delete_Param("")
        </a>
			</text>
        </td>
    </tr>
	i++;
}
	
</table>
 @if (Model.items.PageCount > 1) { 
        @Html.PagedListPager(Model.items, page => Url.Action(MVC.User.Index(page,Model.Search.PageSize,Model.Search.Search??"")),PagedListRenderOptions.PageNumbersOnly)
    }

	<p>
    @Html.ActionLink(PMKB_DAL.PMKBEntities_resource.User_AddNew, MVC.User.Create())
</p>
<script>
function SearchData(){
 Search('@Html.Raw(Url.Action(MVC.User.Index(1, 10, "aaa")))', 'aaa');
}
</script>
		@*Namespace =PMKB_Web.Views.User-------String------System.String*@

			@*FrameworkVersion =4.0-------Version------System.Version*@

			@*AreaName =<null>-------String------System.String*@

			@*AssemblyPath =System.Collections.Generic.List`1[System.String]-------List`1------System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]*@

			@*FileExtension =.cshtml-------String------System.String*@

			@*FileEncoding =System.Text.UTF8Encoding-------Encoding------System.Text.Encoding*@

			@*Errors =<null>-------CompilerErrorCollection------System.CodeDom.Compiler.CompilerErrorCollection*@

			@*TemplateFile =D:\andrei\PMKB\PMKB_Web\CodeTemplates\AddView\CSHTML\MyListSearch.tt-------String------System.String*@

			@*ControllerName =<null>-------String------System.String*@

			@*AddActionMethods =False-------Boolean------System.Boolean*@

			@*ControllerRootName =<null>-------String------System.String*@

			@*ViewName =Index-------String------System.String*@

			@*IsPartialView =False-------Boolean------System.Boolean*@

			@*IsContentPage =True-------Boolean------System.Boolean*@

			@*ReferenceScriptLibraries =True-------Boolean------System.Boolean*@

			@*AutoEventWireup =False-------Boolean------System.Boolean*@

			@*MasterPageFile =-------String------System.String*@

			@*PrimaryContentPlaceHolderID =MainContent-------String------System.String*@

			@*ContentPlaceHolderIDs =System.Collections.Generic.List`1[System.String]-------List`1------System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]*@

			@*OutputFileExtension =.cs-------String------System.String*@

			@*ViewDataTypeName =PMKB_DAL.User-------String------System.String*@

			@*ViewDataType =PMKB_DAL.User-------Type------System.Type*@

			@*EntitySetName =<null>-------String------System.String*@

			@*PrimaryKeys =<null>-------PrimaryKey[]------Microsoft.VisualStudio.Web.Mvc.Scaffolding.BuiltIn.PrimaryKey[]*@

			@*ContextType =<null>-------Type------System.Type*@

			@*ModelType =<null>-------Type------System.Type*@

			@*RelatedProperties =System.Collections.Generic.Dictionary`2[System.String,Microsoft.VisualStudio.Web.Mvc.Scaffolding.BuiltIn.RelatedModel]-------Dictionary`2------System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[Microsoft.VisualStudio.Web.Mvc.Scaffolding.BuiltIn.RelatedModel, Microsoft.VisualStudio.Web.Mvc.3.01, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]*@

	